/*
 * @Author: wangjq4214
 * @Date: 2022-05-03 15:06:26
 * @LastEditTime: 2022-05-03 15:41:10
 * @LastEditors: wangjq4214
 */
import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';
import jotaiDebugLabel from 'jotai/babel/plugin-debug-label';
import jotaiReactRefresh from 'jotai/babel/plugin-react-refresh';
import autoImport from 'unplugin-auto-import/vite';
import WindiCSS from 'vite-plugin-windicss';
import vitePluginForArco from '@arco-plugins/vite-react';
import svgrPlugin from '@arco-plugins/vite-plugin-svgr';

// https://vitejs.dev/config/
export default defineConfig({
  resolve: {
    alias: [{ find: '@', replacement: '/src' }],
  },
  plugins: [
    react({ babel: { plugins: [jotaiDebugLabel, jotaiReactRefresh] } }),
    autoImport({
      include: [/\.[tj]sx?$/, /\.md$/],
      imports: ['react', 'react-router-dom', 'jotai', 'jotai/utils'],
      eslintrc: {
        enabled: true,
      },
    }),
    WindiCSS(),
    svgrPlugin(),
    vitePluginForArco(),
  ],
});
